package com.tttn.docbao.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.widget.Toast;

import com.tttn.docbao.R;
import com.tttn.docbao.adapter.NewsAdapter;
import com.tttn.docbao.customview.PagerSlidingTabStrip;

public class MainActivity extends FragmentActivity {
	private NewsAdapter adapter;
	private int type = 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		Intent intent = getIntent();
		Bundle bundle = intent.getBundleExtra("DATA");
		String name = bundle.getString("name");
		Toast.makeText(getApplicationContext(), name, Toast.LENGTH_SHORT).show();

		ViewPager pager = (ViewPager) findViewById(R.id.bookReaderMainFragment);
		adapter = new NewsAdapter(getSupportFragmentManager(),
				getApplicationContext(), name);
		pager.setAdapter(adapter);
		PagerSlidingTabStrip tab = (PagerSlidingTabStrip) findViewById(R.id.pager_header);
		tab.setViewPager(pager);
	}

}
